package org.jhub1.system.xmpp.proxy;
/*
import java.io.IOException;
import java.util.Iterator;
import nl.chess.it.util.config.ConfigValidationResult;

import org.jhub1.system.xmpp.commands.ElementIQ;
import org.jhub1.system.xmpp.commands.ElementUptime;
import org.jhub1.system.xmpp.commands.NewMessageProcessor;
import org.jhub1.system.xmpp.config.ConfigAdapter;
import org.jhub1.system.xmpp.log.LogAdapter;
import org.jivesoftware.smack.SmackConfiguration;
import org.jivesoftware.smack.XMPPException;

public class Driver {

	
	private static NewMessageProcessor mproc;

	private static LogAdapter log = LogAdapter.getLog(Driver.class);

	private static ConfigAdapter config = ConfigAdapter.getInstance(log);
	
	@SuppressWarnings("rawtypes")
	public static void main(String[] args) throws IOException {
		Thread.currentThread().setName("JHUB1 XMPP Proxy");
		log.info("XMPP gateway proxy starting. SMACK version: " + SmackConfiguration.getVersion());
		
		mproc = new NewMessageProcessor();
		mproc.registerElement("IQ", new ElementIQ());
		mproc.registerElement("uptime", new ElementUptime());

		ConfigValidationResult configResult = config.validateConfiguration();
		*/
/*
		if (configResult.thereAreErrors()) {
			log.error("Errors in configuration");
			StringBuilder errorSb = new StringBuilder();
			for (Iterator iter = configResult.getErrors().iterator(); iter
					.hasNext();) {
				errorSb.append(" > " + iter.next());
			}
			log.error(errorSb.toString());
			System.exit(1);
		}
*/
/*
		if (configResult.thereAreUnusedProperties()) {
			log.warn("Unused properties in the config");
			StringBuilder errorSb = new StringBuilder();
			for (Iterator iter = configResult.getUnusedProperties().iterator(); iter
					.hasNext();) {
				errorSb.append(" -> " + iter.next());
			}
			log.warn(errorSb.toString());
		}

		XMPPProxy conXm;

		try {
			conXm = new XMPPProxy(mproc);
			XMPPProxy.setStatus(config.getInitialStatus());
			log.info("Initiating Jabber engine, setting status.");
			while (true) {
				try {
					Thread.sleep(100);					
				} catch (InterruptedException ex) {
					log.fatal(ex.toString());
				}
				try {
					conXm.incomeChat();
				} catch (InterruptedException ex) {
					log.fatal(ex.toString());
				}
			}
		} catch (XMPPException ex) {
			log.fatal(ex.toString());
		}
	}
}
*/